package com.mew.chess.core.game.pokdeng.game.message;

import com.mew.chess.core.game.pokdeng.game.common.PokDengConstantValue;
import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;

import java.util.List;

/**
 * @author dylin
 * @create 2021/4/25
 */
@Data
@ToString
public class PushOpenCardMessage extends ZebraBaseMessage<PushOpenCardMessage> {
    private final int remainTime = PokDengConstantValue.OPEN_CARD_TIME;

    private CardMessage banker;//庄家牌
    private List<CardMessage> cards;//闲家牌

    @Override
    public void write(ByteBuf b) {

        writeInt(b,remainTime);
        banker.write(b);
        writeInt(b,cards.size());
        for (CardMessage card : cards) {
            card.write(b);
        }
    }

    @Override
    public PushOpenCardMessage read(ByteBuf byteBuf) {
        return null;
    }
}
